package pers.brozen.anka.support.wechat.request;

import lombok.Data;
import lombok.EqualsAndHashCode;
import pers.brozen.anka.support.wechat.ApiDataFormat;
import pers.brozen.anka.support.wechat.ApiRequestMethod;
import pers.brozen.anka.support.wechat.annotations.WeChatApi;
import pers.brozen.anka.support.wechat.annotations.WeChatApiField;
import pers.brozen.anka.support.wechat.response.AccessTokenGetResponse;

/**
 *
 *
 * https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html
 *
 * @author Brozen
 * @date 2019/12/10 10:40 AM
 */
@Data
@EqualsAndHashCode(callSuper = true)
@WeChatApi(url = "https://api.weixin.qq.com/cgi-bin/token", method = ApiRequestMethod.GET, responseFormat = ApiDataFormat.JSON)
public class AccessTokenGetRequest extends WeChatRequest<AccessTokenGetResponse> {

    @WeChatApiField("secret")
    private String appSecret;

    @WeChatApiField("grant_type")
    private final String grantType = "client_credential";

    @Override
    public Class<AccessTokenGetResponse> getResponseClass() {
        return AccessTokenGetResponse.class;
    }

}
